package org.linlinjava.litemall.admin.strategy.ProxyLevel4StrategyImpl;

import com.alipay.api.domain.OpenApiRoyaltyDetailInfoPojo;
import org.linlinjava.litemall.admin.strategy.Interface.AliPayStrategy;
import org.linlinjava.litemall.core.alipay.config.AliPayProperties;
import org.linlinjava.litemall.core.systemConfig.SystemConfig;
import org.linlinjava.litemall.db.domain.LitemallMechanism;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 机构等级为2
 *
 * @author zhy
 * @date 2019-01-25 10:45
 **/
@Service
public class MechanismLevel2s implements AliPayStrategy {
	@Autowired
	private AliPayProperties aliPayProperties;

	@Override
	public OpenApiRoyaltyDetailInfoPojo getModel(LitemallMechanism litemallMechanism ) {
		OpenApiRoyaltyDetailInfoPojo openApiRoyaltyDetailInfoPojo = new OpenApiRoyaltyDetailInfoPojo();
		//分出账户,也就是商家的账户pid
		openApiRoyaltyDetailInfoPojo.setTransOut(aliPayProperties.getTransOutNo());
		//分账金额收款账户pid
		openApiRoyaltyDetailInfoPojo.setTransIn(litemallMechanism.getAlpay());
		openApiRoyaltyDetailInfoPojo.setAmount(SystemConfig.getProxy4Mechanism2());
		openApiRoyaltyDetailInfoPojo.setDesc("一年标准版反馈居间服务费"+SystemConfig.getProxy4Mechanism2()+"元");
		return openApiRoyaltyDetailInfoPojo;
	}

	@Override
	public String getMechanismLevel() {
		return "42";
	}
}
